package com.yanqu.road.entity.player;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.math.BigInteger;

/**
 * @Author wpj
 * @Date 2020/8/30
 */
@FieldTypeAnnotation(tableName = "t_u_charitable")
public class UserCharitable extends DataObject {
    @FieldTypeAnnotation(select = true, update = true)
    long userId;
    @FieldTypeAnnotation(desc = "重置时间")
    long resetTime;
    @FieldTypeAnnotation(desc = "今日行善次数")
    int todayCharitableTimes;
    @FieldTypeAnnotation(desc = "随机到的行善地点")
    int charitableType;
    @FieldTypeAnnotation(desc = "是否已进入系统")
    boolean inSystem;
    @FieldTypeAnnotation(desc = "历史银两总消耗")
    BigInteger allCostMoney = BigInteger.ZERO;


    public long getUserId() {
        return userId;
    }

    public long getResetTime() {
        return resetTime;
    }

    public int getTodayCharitableTimes() {
        return todayCharitableTimes;
    }

    public int getCharitableType() {
        return charitableType;
    }

    public boolean isInSystem() {
        return inSystem;
    }

    public BigInteger getAllCostMoney() {
        return allCostMoney;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }

    }
    public void setResetTime(long resetTime) {
        if (this.resetTime != resetTime) {
            this.resetTime = resetTime;
            setOp(DataStatus.Update);
        }

    }
    public void setTodayCharitableTimes(int todayCharitableTimes) {
        if (this.todayCharitableTimes != todayCharitableTimes) {
            this.todayCharitableTimes = todayCharitableTimes;
            setOp(DataStatus.Update);
        }

    }
    public void setCharitableType(int charitableType) {
        if (this.charitableType != charitableType) {
            this.charitableType = charitableType;
            setOp(DataStatus.Update);
        }

    }
    public void setInSystem(boolean inSystem) {
        if (this.inSystem != inSystem) {
            this.inSystem = inSystem;
            setOp(DataStatus.Update);
        }

    }
    public void setAllCostMoney(BigInteger allCostMoney) {
        if(null == allCostMoney){
            return;
        }
        if(!this.allCostMoney.equals(allCostMoney)) {
            this.allCostMoney = allCostMoney;
            setOp(DataStatus.Update);
        }
    }


}
